-
Notifications
You must be signed in to change notification settings - Fork 121
Order creation: Prevent subscription products to be added to an order #15960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order creation: Prevent subscription products to be added to an order #15960
Conversation
|
|
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During testing, I was still able to add a variation from a variable subscription product. Is it expected? I thought tapping on the variable subscription product would be disabled since it's grayed out.
Simulator.Screen.Recording.-.iPad.Air.13-inch.M3.-.2025-07-31.at.06.19.01.mp4
The call to .onTapGesture for variations in the product selector was bypassing the product type check, and navigating the merchant to the variations view, where they could add subscription products to the order
Thanks for testing, it seems my own store trolled me and variable subscriptions weren't actually variable but simple 🤦
The problem relied on variations being handled via a call inside I've added a new isSubscription check on debe2a9 which now resolves the problem, as well as additional unit tests: Screen.Recording.2025-07-31.at.11.42.28.mov |
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts about the latest update, let me know what you think!
| @ViewBuilder private func createProductRow(rowViewModel: ProductRowViewModel) -> some View { | ||
| if viewModel.isVariableProduct(productOrVariationID: rowViewModel.productOrVariationID), | ||
| configuration.treatsAllProductsAsSimple == false { | ||
| let isSubscription = viewModel.isSubscriptionProduct(productOrVariationID: rowViewModel.productOrVariationID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Is it possible to use ProductRowViewModel.SelectedState == unsupported to determine whether a row is selectable/tappable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use ProductRowViewModel.SelectedState == unsupported to determine whether a row is selectable/tappable?
That's a good point, I didn't see it right away but the existing selectionEnabled returns false when selectedState == .unsupported, which covers all unsupported product types and we won't need to perform check per-product-type, just expand the list, which is more maintainable in the long term. Updated here: b419d94 . This also comes with the subscription check being used only on tests, so I removed these here 866c91c
nit: the DisclosureIndicator() can be hidden too if the row isn't tappable
Good UI suggestion, updated: b5e48c7 so it's hidden now for non-selectable variable products.
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ![]()



Closes WOOMOB-938
Description
This PR disallows adding product of type
subscriptionandvariableSubscriptionto an order via creation or edition flows. Since subscriptions are not currently supported in the app, restricting adding these product types from the get-go will set the expectations right away and remove potential confusion and issues like the one raised in WOOMOB-938Changes
We leverage the existing
bookingsimplementation and add these two product types as well to the mix. This will disallow the specific product type from being selected and added to the order in both creation and edition flows.Testing information
Screenshots
Screen.Recording.2025-07-30.at.15.14.25.mov
RELEASE-NOTES.txtif necessary.